package com.fzhucc.modules.expert.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
* @description 专家线下辅导配置表 /
* @author yyg
* @date 2023-10-20
**/
@Entity
@Data
@Table(name="tt_expert_offline_config")
public class ExpertOfflineConfig implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`expert_id`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "专家id")
    private Integer expertId;

    @Column(name = "`day`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "日期")
    private String day;

    @Column(name = "`address`")
    @ApiModelProperty(value = "地址")
    private String address;

    @Column(name = "`limits_count`")
    @ApiModelProperty(value = "限制人数 最多多少人报名")
    private Integer limitsCount;

    @Column(name = "`time_slot`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "时间段")
    private String timeSlot;

    /*@Column(name = "`is_show`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "是否h5 小程序展示 默认展示")
    private Integer isShow;

    @Column(name = "`sort`")
    @ApiModelProperty(value = "排序")
    private Integer sort;*/

    @Column(name = "`is_delete`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "是否假删除 默认不删除")
    private Integer isDelete;

    public void copy(ExpertOfflineConfig source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
